// 基础Api
import { Navigate, useRoutes } from 'react-router-dom';
import Welcome from '@/views/Welcome';
import Login from '@/views/Login';
import Error404 from '@/views/Error404';

// 动态路由是指匹配路径中包含动态参数的规则。
const router = [
  {
    path: '/',
    element: <Welcome />
  },
  {
    path: '/login',
    element: <Login />
  },
  {
    path: '/404',
    element: <Error404 />
  },
  {
    path: '*',
    element: <Navigate to={'/404'} />
  }
];

export default function Router() {
  return useRoutes(router);
}

// export default createBrowserRouter(router);
